<template>
  <div class="line-echart" ref="main">

  </div>
</template>
<script setup lang="ts">
import * as echarts from 'echarts';
import { onMounted, ref } from 'vue';
let main = ref<HTMLDivElement | null>(null);
onMounted(() => {
  let chart = echarts.init(main.value);
  let option = {
    title: {
      text: 'ECharts'
    },
    tooltip: {},
    xAxis: {
      data: ['x', 'xx', '信', '信信', '噢莫', '袜子']
    },
    yAxis: {},
    series: [
      {
        name: '销量',
        type: 'line',
        data: [5, 20, 36, 10, 10, 20]
      }
    ]
  }
  chart.setOption(option)
})
</script>
<style scoped>
.line-echart {
  width: 100%;
  height: 100%;
}
</style>
